<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDistributionListsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('distribution_lists', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('user_id')       ->default(0)->comment('用户id');
            $table->bigInteger('img_id')        ->default(0)->comment('头像');
            $table->string('name')              ->default('')->comment('姓名');
            $table->string('phone')             ->default('')->comment('手机');
            $table->decimal('total_money')      ->default(0)->comment('累计获得佣金');
            $table->timestamp('settling_time')  ->nullable()->comment('入驻时间');
            $table->integer('type')             ->nullable()->comment('分销商类型0普通分销商，1特约分销商');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('distribution_lists');
    }
}
